package com.itheima.Oop02;

public class Phone {
    String name,number;
    String label;
    int version;
    double price;
    boolean condition = true;

    public void show(){
        System.out.println(name+"的"+label+"手机型号为"+version+",价格是"+price+"元");
    }
    public void call(Phone p){
        System.out.println(name+"给"+p.name+"打电话");
        System.out.println("正在拨通 " +p.number);
        System.out.println("---------------------");
        respond(p);
    }
    public void respond(Phone p){
        if (p.condition){
            System.out.println("已接通");
            System.out.println();
        }else {
            System.out.println("Sorry, the number you dialed is busy now, please redial later !");
            System.out.println();
        }
    }
    public void busy(){
        condition = false;
    }
}
